package JSE_02.Demo;

import java.util.ArrayList;
import java.util.Collections;

public class DemoTest {
    public static void main(String[] args){
        ArrayList<String> poker=new ArrayList<>();
        String[] Colors={"♠","♥","♣","♦"};
        String[] Numbers={"2","A","K","Q","J","10","9","8","7","6","5","4","3"};

        poker.add("大王");
        poker.add("小王");

        for(String col:Colors){
            for(String num:Numbers){
                poker.add(col+num);
            }
        }

        System.out.println(poker);
        System.out.println("==============");
        Collections.shuffle(poker); // 洗牌方法
        System.out.println(poker);

        ArrayList<String> player_00=new ArrayList<>();
        ArrayList<String> player_01=new ArrayList<>();
        ArrayList<String> player_02=new ArrayList<>();
        ArrayList<String> dipai=new ArrayList<>();

        System.out.println("==============");
        for(int i=0;i<poker.size();i++){
            String p=poker.get(i);
            if(i>50){
                dipai.add(p);
            }else if(i%3==0){
                player_00.add(p);
            }else if(i%3==1){
                player_01.add(p);
            }else if(i%3==2){
                player_02.add(p);
            }
        }

        System.out.println(player_00);
        System.out.println(player_01);
        System.out.println(player_02);
        System.out.println(dipai);
    }
}
